#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
#include <iostream>

using namespace std;

struct Thread
{
    private:
        int _id;

    public:
        Thread(int id) : _id(id) {}
        void operator() ()
        {
            for (int i=0; i<5; i++) {
                cout << _id*5*i << endl;
                sleep(2);
            }
        }
};

int count(int id)
{
    for (int i=0; i<5; i++) {
        cout << id*5*i << endl;
        sleep(2);
    }
    return 0;
}

int main()
{
    boost::thread th1(Thread(1));
    sleep(1);
    boost::thread th2(Thread(10));
    sleep(1);

    boost::thread th3(boost::bind(count, 50));
    th1.join();
    th2.join();
    th3.join();

    return 0;
}

